<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$CONF['mallTitle']}后台管理中心</title>
<link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="__ROOT__/Apps/Admin/View/css/AdminLTE.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
<script src="__PUBLIC__/js/jquery.min.js"></script>
<script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
</head>
<style type="text/css">
#one{width:200px; height:180px; float:left}
#two{width:50px; height:180px; float:left}
#three{width:200px; height:180px; float:left}
.select-btn{width:50px; height:30px; margin-top:10px; cursor:pointer;}
.line-style{ line-height:40px; font-size:14px; text-indent:15px;}
.line-style label{ margin-right:5px; margin-left:10px;}
</style>
<body class='mxc-page'>
<form method='get' action='{:U("Admin/Users/sendSysMsg")}'>
   <div class='mxc-tbar'>
   用户名：<input type='text' id='userName' name='userName' class='form-control mxc-ipt-10' value='{$userName}'/>
   手机号码：<input type='text' id='userPhone' name='userPhone' class='form-control mxc-ipt-10' value='{$userPhone}'/>
   会员类型：<select id='userType' name='userType' class="form-control mxc-ipt-10">
       <option value='-1' <if condition=" $userType eq -1 ">selected</if>>全部</option>
       <option value='0' <if condition=" $userType eq 0 ">selected</if>>普通会员</option>
       <option value='1' <if condition=" $userType eq 1 ">selected</if>>店铺会员</option>
   </select>  
<button type="submit" class="btn btn-primary glyphicon glyphicon-search">查询</button> 
<!--<php>if(in_array('hylb_01',$MXC_STAFF['grant'])){</php>
   <a class="btn btn-success glyphicon glyphicon-plus" href='{:U("Admin/Users/toEdit")}' style='float:right'>新增</a>
<php>}</php>  -->   
   </div>
   </form>
<div class="mxc-body">
<form method="post" action="{:U('Admin/Users/sendSysMsg')}" onsubmit="return onSubmit()">
<div  id="selectMem">
<div class="line-style">选择会员：</div>
  <table width="700" border="0" cellpadding="0" cellspacing="0" class="newContTab">
    <tr>
      <th>&nbsp;</th>
      <td><div>
          <div>
            <select multiple="multiple" id="select1" style="width:250px;height:330px; float:left; border:4px #A0A0A4 outset; padding:4px; ">
              <if condition="!empty($user)">
              <volist name="user" id="vo">
              <option value="{$vo['userId']}">{$vo['userPhone']}【{$vo['userName']}】</option>
              </volist>
              </if>
            </select>
          </div>
          <div style="float:left; margin:0 10px"> <span id="add">
            <input type="button" class="select-btn" value=">"/>
            </span><br />
            <span id="add_all">
            <input type="button" class="select-btn" value=">>"/>
            </span> <br />
            <span id="remove">
            <input type="button" class="select-btn" value="<"/>
            </span><br />
            <span id="remove_all">
            <input type="button" class="select-btn" value="<<"/>
            </span> </div>
          <div>
            <select multiple="multiple" name="userId-box" id="select2" style="width: 250px;height:330px; float:lfet;border:4px #A0A0A4 outset; padding:4px;">
            </select>
          </div>
        </div></td>
    </tr>
  </table>
  </div>
  <input type="hidden" name="userIds" id="userIds" value="">
  <div class="line-style">推送到所有会员：
  	<label>否</label><input type="radio" name="isAll" value="0" onClick="isAllChange(0)">
    <label>是</label><input type="radio" name="isAll" value="1" onClick="isAllChange(1)">
  </div>
  <div class="line-style">推送到所有会员：
  </div>
  <div style="margin-left:20px;">
  	<textarea name="msg" cols="80" rows="6"></textarea>
  </div>
  <button type="submit" class="btn btn-primary" style="margin-left:20px; margin-top:8px;">发送</button>
  </form>
</div>
<script type="text/javascript">
function isAllChange(val) {
	if(val == 1) {
		$("#selectMem").css('display','none');
	} else {
		$("#selectMem").css('display','block');
	}
}

function onSubmit() {
	 var str = $("#select2 option").map(function(){return $(this).val();}).get().join(",");
	 $("#userIds").val(str);
	 
	 return true;
}

$(function(){
    //移到右边
    $('#add').click(function() {
    //获取选中的选项，删除并追加给对方
        $('#select1 option:selected').appendTo('#select2');
    });
    //移到左边
    $('#remove').click(function() {
        $('#select2 option:selected').appendTo('#select1');
    });
    //全部移到右边
    $('#add_all').click(function() {
        //获取全部的选项,删除并追加给对方
        $('#select1 option').appendTo('#select2');
    });
    //全部移到左边
    $('#remove_all').click(function() {
        $('#select2 option').appendTo('#select1');
    });
    //双击选项
    $('#select1').dblclick(function(){ //绑定双击事件
        //获取全部的选项,删除并追加给对方
        $("option:selected",this).appendTo('#select2'); //追加给对方
    });
    //双击选项
    $('#select2').dblclick(function(){
       $("option:selected",this).appendTo('#select1');
    });
});
</script>

</body>
</html>